<?php
class Futures_variety_model extends CI_Model
{

    public function __construct()
    {
        parent::__construct();
        // 加载数据库
        $this->load->database();
    }

    public function selectByCode($code)
    {
        $this->db->select("*");
        $this->db->from("tw_lucky_cat.futures_variety");
        
        $this->db->where('code', $code);
        
        $query = $this->db->get();
        if ($query->num_rows() > 0) {
            return $query->row();
        }
        return false;
    }
}